package com.mMap.entity.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mMap.entity.enums.DateTimePatternEnum;
import com.mMap.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * 订单信息
 */
public class OrderInfo implements Serializable {


    /**
     * 订单名称
     */
    private String title;

    /**
     * 订单id
     */
    private String orderId;

    /**
     * 订单总价
     */
    private String price;
    /**
     * 创建人
     */
    private String creator;
    /**
     * 创建人id
     */
    private String creatorId;
    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 支付状态0未支付1已支付2已弃用
     */
    private Integer status;


    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return this.title;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderId() {
        return this.orderId;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getPrice() {
        return price;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return this.status;
    }

    @Override
    public String toString() {
        return "订单:" + (title == null ? "空" : title) + "，id:" + (orderId == null ? "空" : orderId)  + "，订单总价:" + (price == null ? "空" : price)  + "，创建人:" + (creator == null ? "空" : creator)  + "，创建人id:" + (creatorId == null ? "空" : creatorId)  + "，备注:" + (remark == null ? "空" : remark) + "，创建时间:" + (createTime == null ? "空" : DateUtil.format(createTime,
                DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())) + "，支付状态0未支付1已支付2已弃用：" + (status == null ? "空" : status);
    }
}
